package com.han.utils;

import org.springframework.util.DigestUtils;

public class Md5Util {

    //加入一个盐值，用户混淆
    private final static String salt = "sdaf6546y65l;uq234o;i";

    public static String getMd5(long message){
        String base = message + "/" + salt;
        return   DigestUtils.md5DigestAsHex(base.getBytes());

    }

    public static String setMd5(String message){

        StringBuilder a=DigestUtils.appendMd5DigestAsHex(message.getBytes(), new StringBuilder("sdaf6546y65l;uq234o;i"));


        return null;
    }

    public static void main(String[] args) {

        String a=getMd5(123456);
        System.out.println(a);

    }

}
